package com.lanyou.esb.entity;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.EntityListeners;
import javax.persistence.GeneratedValue;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import org.hibernate.annotations.GenericGenerator;
import org.springframework.data.annotation.CreatedBy;
import org.springframework.data.annotation.CreatedDate;
import org.springframework.data.annotation.LastModifiedBy;
import org.springframework.data.annotation.LastModifiedDate;
import org.springframework.data.jpa.domain.support.AuditingEntityListener;

import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.lanyou.cook.common.DefaultDateJsonSerializer;

@Entity
@EntityListeners({AuditingEntityListener.class})
@Table(name = "T_ESB_BU_WSDL_METADATA_DETAIL")
public class WsdlMetaDataDetail {

	private String id;
	
	private String interfaceMethod;
	
	private String interfaceRequestMsg;
	
	private WsdlMetaData wsdlMetaData;
	
	private String isEnable;
	
	private String creator;
	
	private Date createTime;

	private String modifier;

	private Date modifyTime;

	@Id
	@GeneratedValue(generator = "uuidGenerator")
	@GenericGenerator(name = "uuidGenerator", strategy = "uuid")
	@Column(name = "WSDL_METADATA_DETAIL_ID", length = 36)
	public String getId() {
		return id;
	}

	public void setId(String id) {
		this.id = id;
	}

	@Column(name = "IF_FUNCTION", length = 50)
	public String getInterfaceMethod() {
		return interfaceMethod;
	}

	public void setInterfaceMethod(String interfaceMethod) {
		this.interfaceMethod = interfaceMethod;
	}

	@Column(name = "IF_REQUEST_MESS", length = 1000)
	public String getInterfaceRequestMsg() {
		return interfaceRequestMsg;
	}

	public void setInterfaceRequestMsg(String interfaceRequestMsg) {
		this.interfaceRequestMsg = interfaceRequestMsg;
	}


	@ManyToOne
	@JoinColumn(name = "WSDL_METADATA_ID")
	public WsdlMetaData getWsdlMetaData() {
		return wsdlMetaData;
	}

	public void setWsdlMetaData(WsdlMetaData wsdlMetaData) {
		this.wsdlMetaData = wsdlMetaData;
	}

	
	@Column(name = "IS_ENABLE", length = 2)
	public String getIsEnable() {
		return isEnable;
	}

	public void setIsEnable(String isEnable) {
		this.isEnable = isEnable;
	}
	
	
	@CreatedBy
	@Column(name = "CREATOR", length = 50, updatable=false)
	public String getCreator() {
		return creator;
	}

	public void setCreator(String creator) {
		this.creator = creator;
	}

	@LastModifiedBy
	@Column(name = "MODIFIER", length = 50)
	public String getModifier() {
		return modifier;
	}

	public void setModifier(String modifier) {
		this.modifier = modifier;
	}

	@Column(name = "CREATED_DATE", updatable=false)
	@JsonSerialize(using = DefaultDateJsonSerializer.class)
	@CreatedDate
	public Date getCreateTime() {
		return createTime;
	}

	public void setCreateTime(Date createTime) {
		this.createTime = createTime;
	}

	@Column(name = "LAST_UPDATED_DATE")
	@JsonSerialize(using = DefaultDateJsonSerializer.class)
	@LastModifiedDate
	public Date getModifyTime() {
		return modifyTime;
	}

	public void setModifyTime(Date modifyTime) {
		this.modifyTime = modifyTime;
	}
	
	
}
